package framework.ui;

import java.util.List;

import org.openems.entity.Key;

import framework.DomainService;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.Control;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;

public class ButtonPanel extends Pane {
	private VBox vbox = new VBox();
	private DomainService service;
	
	public ButtonPanel(List<Key> keys, DomainService service) {
		this.service = service;
		this.setPrefWidth(150);
		vbox.setStyle("-fx-font: 14pt \"SansSerif\";-fx-text-fill: #006666;-fx-background-radius: 10;-fx-padding: 1;");
		for (Key key : keys) {
			this.addButton(key);
		}
		this.getChildren().add(vbox);
	}
	
	public void addButton(Key key) {
		EmsButton button = new EmsButton(key, this.service);
		this.addButton(button.getButton());
	}

	public void addButton(Button button) {
		button.setPrefSize(150, 30);
//		button.prefWidth(150);
//		button.prefHeight(30);
//		button.minWidth(150);
//		button.minHeight(30);
		vbox.getChildren().add(button);
	}
	
}
